<template>
  <div class="cart" v-if="this.loginToken.token">
    <back-title :message="message"></back-title>
    <cart-items></cart-items>
    <menubar></menubar>
  </div>
  <select-login v-else></select-login>
</template>

<script>
  import {
    mapState
  } from 'vuex'
  import SelectLogin from '../../components/login/SelectLogin.vue'
  import menubar from '../../components/MenuBar.vue'
  import BackTitle from '../../components/BackHeader/BackTitle.vue'
  import CartItems from './base/CartItems.vue'
  export default {
    components: {
      menubar,
      BackTitle,
      CartItems,
      SelectLogin
    },
    data() {
      return {
        message: '我的购物车'
      }
    },
    computed: {
      ...mapState(["userInfo", "shopCart", "loginToken"])
    }
  }
</script>

<style scoped>
  .cart {
    height: 100%;
    background-color: #F2F2F2;
  }
</style>
